<?php
//print_r($_GET);die;//Array ( [cart_id] => 69 [num] => 1 [snums] => 100 [type] => 2 ) Array ( [number] => 1 [num] => 1 [type] => 3 [edit] => 修改 )
//print_r($_COOKIE);die;
include_once("../function.php");

//1判断用户是否登录
if(!isset($_COOKIE['username']))
{
	msg("尚未登录，请登录","./login.php");exit;
}
extract($_GET);//$id $num $type
$cart_id=trim($cart_id);
$num=trim($num);
$snums=trim($snums);
//echo $num;die;
if($num<$snums)
{
	$num=$num+1;
	$sql="update ts_cart set num='$num' where cart_id='$cart_id'";
	$res=mysqli_query($link,$sql);
	if($res)
	{
		if(mysqli_affected_rows($link)>0)
		{
			header("location:./shopcar.php");exit;
		}		
	}		
}	
else
{
	header("location:./shopcar.php");exit;
}
?>